<?php require_once('Connections/congress.php'); ?>
<?php include('functions.php'); ?>
<?php
$colname_session_list = "-1";
if (isset($_GET['ID_CONGRESS'])) {
  $colname_session_list = (get_magic_quotes_gpc()) ? $_GET['ID_CONGRESS'] : addslashes($_GET['ID_CONGRESS']);
}
mysql_select_db($database_congress, $congress);
$query_session_list = sprintf("SELECT * FROM `SESSION` WHERE ID_CONGRESS = %s", $colname_session_list);
$session_list = mysql_query($query_session_list, $congress) or die(mysql_error());

$totalRows_session_list = mysql_num_rows($session_list);
?>

<select name="ID_SESSION" style="width:250px;" id="ID_SESSION">

<?php while ($row_session_list = mysql_fetch_assoc($session_list)) { ?>

	<option value="<?php echo $row_session_list['ID_SESSION']; ?>"
		<?php 
			$selected = getValor('ID_SESSION');  
			if ($selected == $row_session_list['ID_SESSION']) { echo "selected='selected'"; } ?> >
		<?php echo $row_session_list['NAME']; ?>
	</option>

<?php } ?>

</select>

<?php
mysql_free_result($session_list);
?>